<?php
include 'header_admin.php'
?>
<link href="css/new.css" rel="stylesheet" type="text/css"/>
<script src="ckeditor/ckeditor.js" type="text/javascript" language="javascript" ></script>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
    <h1 class="page-header">Bài viết / Thêm bài viết</h1>
    <section>
        <div class="container_form">
            <div class="row">
                <form class="form-horizontal" role="form" action="article-add.php" method="post">						 
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Tiêu đề</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="name" id="inputEmail3" placeholder="Tiêu đề bài viết">
                            <?php if (!empty($NameError)): ?>
                                <span class="help-inline"><?php echo $NameError; ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Danh mục</label>
                        <div class="col-sm-10">
                            <select name="category" class="form-control">
                            </select>						      	
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Đường dẫn</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="name" id="inputEmail3" placeholder="Đường dẫn">
                            <?php if (!empty($NameError)): ?>
                                <span class="help-inline"><?php echo $NameError; ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Địa chỉ</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="name" id="inputEmail3" placeholder="Địa chỉ">
                            <?php if (!empty($NameError)): ?>
                                <span class="help-inline"><?php echo $NameError; ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Tỉnh thành</label>
                        <div class="col-sm-10">
                            <select name="category" class="form-control">
                            </select>						      	
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Hình ảnh</label>
                        <div class="col-sm-10">
                            <input type="text" id="Image" style="width:42%; float:left" class="form-control" name="image" id="inputEmail3" placeholder="Chọn hình ảnh thumb">
                            <input type="button" id="BrowseImageIcon" style="width:15%; float:left" class="btn btn-success" value="Duyệt ảnh" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Nội dung</label>
                        <div class="col-sm-10">
                            <textarea name="content" class="ckeditor" placeholder="Nhập mô tả" rows="3"></textarea>					      						      
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Từ khóa</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="name" id="inputEmail3" placeholder="Từ khóa">
                            <?php if (!empty($NameError)): ?>
                                <span class="help-inline"><?php echo $NameError; ?></span>
                            <?php endif; ?>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">Hiển thị</label>
                        <div class="col-sm-2">
                            <select name="status" class="form-control">							      			              							              		
                                <option value="1">Có</option>		
                                <option value="0">Không</option>	              				
                            </select>							      	
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-offset-2 col-sm-10">
                            <button type="submit" class="btn btn-success">Xuất bản</button>
                            <a class="btn" href="article.php">Quay lại</a>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </section>
    <script type="text/javascript">
        $(function() {
            $("#BrowseImageIcon").click(function() {
                var ckfider = new CKFinder();
                ckfider.selectActionFunction = function(fileUrl) {
                    $("#Image").val(fileUrl);
                };
                ckfider.popup();
            })
        });
    </script>
</div>